#include<iostream>
#include<cstring>
using namespace std;

const int N=15;
int t[N], d[N], l[N];
bool sign[N];
int n;


bool dfs(int pos, int time)
{
	if(pos>n)
	{
		return true;
	}
	for(int i=1; i<=n; i++)
	{
		if(sign[i]) continue;
		if(time > (t[i]+d[i])) continue;
		int newtime = max(time, t[i])+l[i];
		sign[i]=true;
		if(dfs(pos+1, newtime)) return true;
		sign[i]=false;
	}
	return false;
}
int main()
{
	int k; cin>>k; 
	while(k--)
	{
		cin>>n;
		for(int i=1; i<=n; i++) cin>>t[i]>>d[i]>>l[i];
		memset(sign, 0, sizeof(sign));
		if(dfs(1, 0)) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}
